package br.com.linkcom.sined.geral.bean;

import java.util.List;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.OneToMany;


@Entity
public class Tela {

	protected Integer cdtela;
	protected String descricao;
	protected String path;
	protected List<Permissao> listaPermissao;
	
	@Id
	public Integer getCdtela() {
		return cdtela;
	}
	public String getDescricao() {
		return descricao;
	}
	public String getPath() {
		return path;
	}
	@OneToMany(mappedBy="tela")
	public List<Permissao> getListaPermissao() {
		return listaPermissao;
	}

	public void setCdtela(Integer cdtela) {
		this.cdtela = cdtela;
	}
	public void setDescricao(String descricao) {
		this.descricao = descricao;
	}
	public void setPath(String path) {
		this.path = path;
	}
	public void setListaPermissao(List<Permissao> listaPermissao) {
		this.listaPermissao = listaPermissao;
	}

	@Override
	public boolean equals(Object obj) {
		if(obj !=null && obj instanceof Tela){
			if(this.path!=null && obj!=null && ((Tela) obj).path!=null) 
				return this.path.equals( ((Tela)obj).path);
		}
		return false;
	}
}